@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;
  --radius: 0.5rem;
}

body {
  background-color: hsl(43, 76%, 85%); /* ancient-scroll */
  color: hsl(30, 40%, 20%); /* ancient-text */
  font-family: "STKaiti", "KaiTi", "SimKai", serif;
}

.ancient-mode div {
  writing-mode: vertical-rl;
}

/* 添加响应式样式 */
@media (max-width: 640px) {
  .character-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
  }

  .character-cell {
    width: 2.75rem;
    height: 2.75rem;
  }

  .toolbar-button {
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
  }

  .page-indicator {
    min-width: 2.5rem;
  }
}

/* 图片容器样式 */
.character-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-number {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 0.65rem;
  background-color: rgba(243, 232, 211, 0.7);
  padding: 0 0.25rem;
  border-radius: 0.125rem;
}

.fadeIn {
  animation: fade-in 0.4s forwards;
}
.fadeOut {
  animation: fade-out 0.4s forwards;
}
@keyframes fade-in {
  0% {
    display: none;
    opacity: 0;
  }
  100% {
    display: block;
    opacity: 1;
  }
}
@keyframes fade-out {
  0% {
    display: block;
    opacity: 1;
  }
  100% {
    display: none;
    opacity: 0;
  }
}

.writing-vertical {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.5em;
}

@media (max-width: 640px) {
  .writing-vertical {
    letter-spacing: 0.25em;
  }
}

.tab-bar-transition {
  transition: transform 0.3s ease;
}

.avatar-transition {
  transition: all 0.3s ease;
}